package cn.javase.concurrent._并发编程._04_共享模型之管程._活跃性._饥饿;

import cn.javase.concurrent._并发编程._04_共享模型之管程._活跃性._死锁.Chopstick;
import cn.javase.concurrent._并发编程._04_共享模型之管程._活跃性._死锁.Philosopher;

public class TestHunger {
    public static void main(String[] args) {
        Chopstick c1 = new Chopstick("1");
        Chopstick c2 = new Chopstick("2");
        Chopstick c3 = new Chopstick("3");
        Chopstick c4 = new Chopstick("4");
        Chopstick c5 = new Chopstick("5");
        new Philosopher("苏格拉底", c1, c2).start();
        new Philosopher("柏拉图", c2, c3).start();
        new Philosopher("亚里士多德", c3, c4).start();
        new Philosopher("赫拉克利特", c4, c5).start();
        new Philosopher("阿基米德", c1, c5).start();
    }
}
